<h1>New User</h1>

<%= form_for @user do |f| %>
  <% if @user.errors.any? %>
    <div class='error_messages'>
      <h2>Form is invalid</h2>
      <ul>
        <% @user.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div class='form-inputs'>
    <div class='form-group'>
      <%= f.label :email %><br>
      <%= f.text_field :email %>
    </div>
    <div class='form-group' id='password'>
      <%= f.label :password %><br>
      <%= f.password_field :password %>
    </div>
    <div class='form-group' id='password_confirmation'>
      <%= f.label :password_confirmation %><br>
      <%= f.password_field :password_confirmation %>
    </div>
    <div class='form-group'>
      <%= f.label :admin do %>
        <%= f.check_box :admin %>
        Administrator?
      <% end %>
    </div>
  </div>

  <div class='form-actions'>
    <%= f.submit 'Create User', class: 'btn btn-primary' %>
  </div>
<% end %>
